const APP_NAME = __APP_NAME__;

document.title = APP_NAME;

import { createApp } from 'vue';

import App from './App.vue';

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import ElIconModules from '@element-plus/icons-vue'

import vant, { Toast } from 'vant';
import 'amfe-flexible/index.js';
import router from './router';
import store from './store.js';
import 'vant/lib/index.css';

import { setupI18n } from './lang/setup';

import './css/common.css';
const app = createApp(App);

//  统一注册el-icon图标
// for(let iconName in ElIconModules){
//     app.component(iconName,ElIconModules[iconName])
// }


setupI18n(app);

app.config.globalProperties.fromWei = function(value, decimals=18) {
    // return (value/(10**18)).toFixed(8);
    return (value/(10**18)).toFixed(0);
}

// window.Toast = Toast;
window.Toast = function(msg) {
    alert(msg)
};

app.use(router);
app.use(store);
app.use(vant);
app.use(ElementPlus)
app.mount('#app');
